﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using VNPT.Data;

namespace VNPT.DataExport
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string cnn = string.Format("Data Source={0};User Id={1};Password={2};", "DAKLAK_6", "doisoat", "doisoat");
            DbNetData Db = new DbNetData(cnn, DataProvider.OracleClient);
            Db.Open();
            var dt = Db.GetDataTable(new QueryCommandConfig("select * from tam_cddlk_cdvtt_0414_thuyen"));

            
            Spire.DataExport.DBF.DBFExport DBFExport = new Spire.DataExport.DBF.DBFExport();
            DBFExport.DataSource = Spire.DataExport.Common.ExportSource.DataTable;
            DBFExport.DataTable = dt;
            DBFExport.ActionAfterExport = Spire.DataExport.Common.ActionType.OpenView;
            DBFExport.FileName = @"E:\DBF0401.dbf";
            DBFExport.SaveToFile();
            MessageBox.Show("Test");

        }
    }
}
